{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_iframe_show('{dr_lang('一键生成')}', '{dr_url('linkage/cache_index', ['key'=>$key])}', '500px', '300px');">{dr_lang('一键生成联动菜单数据')}</a></p>
</div>

<div class="right-card-box">
    <form class="form-horizontal" role="form" id="myform">
        {dr_form_hidden()}
        <div class="bootstrap-table2 bootstrap-table">
            <div id="toolbar" class="toolbar">

                {if $ci->_is_admin_auth('del')}
                <label><button type="button" onclick="dr_ajax_option('{dr_url('linkage/list_del', ['key'=>$key])}', '{dr_lang('你确定要删除它们吗？')}', 1)" class="btn red btn-sm"> <i class="fa fa-trash"></i> {dr_lang('删除')}</button></label>
                {/if}
                {if $ci->_is_admin_auth('edit')}
                <label><button type="button" onclick="dr_ajax_option('{dr_url('linkage/open_edit', ['key'=>$key])}', '{dr_lang('你确定要启用它们吗？')}', 1)" class="btn blue btn-sm"> <i class="fa fa fa-check-circle"></i> {dr_lang('启用')}</button></label>
                <label><button type="button" onclick="dr_ajax_option('{dr_url('linkage/close_edit', ['key'=>$key])}', '{dr_lang('你确定要禁用它们吗？')}', 1)" class="btn red btn-sm"> <i class="fa fa fa-times-circle"></i> {dr_lang('禁用')}</button></label>

                <label style="margin-right: 3px;"><button type="button" onclick="dr_ajax_option('{dr_url('linkage/pid_edit', ['key'=>$key])}', '{dr_lang('你确定要批量移动它们吗？')}', 1)" class="btn green btn-sm"> <i class="fa fa-edit"></i> {dr_lang('变更分类')}</button></label>
                <label style="margin-top:5px;">{$select}</label>
                {/if}
            </div>
        </div>

        <div class="clearfix"></div>
        <div class="table-scrollable table-clearfix">
            <table class="table table-noborder table-fc-upload table-striped table-bordered table-hover table-checkable dataTable">
                <thead>
                <tr class="heading">
                    {if $ci->_is_admin_auth('del')}
                    <th class="myselect">
                        <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            <input type="checkbox" class="group-checkable" data-set=".checkboxes" />
                            <span></span>
                        </label>
                    </th>
                    {/if}
                    <th width="70" style="text-align:center"> {dr_lang('排序')} </th>
                    <th width="60" style="text-align:center"> {dr_lang('状态')} </th>
                    <th width="70"> Id </th>
                    <th> {dr_lang('名称 / 别名')} </th>
                    <th>
                        {if $ci->_is_admin_auth('add')}<a href="javascript:dr_iframe('add', '{dr_url('linkage/listk_add', ['key'=>$key,'pid'=>$pid])}');" class="btn btn-xs blue"> <i class="fa fa-plus"></i> {dr_lang('快速添加')} </a>{/if}
                        <a href="{dr_url('linkage/list_index', ['key'=>$key,'pid'=>0])}" class="btn btn-xs dark"> <i class="fa fa-reply"></i> {dr_lang('全部数据')} </a>
                    </th>
                </tr>
                </thead>
                <tbody>
                {loop $list $t}
                <tr class="odd gradeX" id="dr_row_{$t.id}">
                    {if $ci->_is_admin_auth('del')}
                    <td class="myselect">
                        <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                            <input type="checkbox" class="checkboxes" name="ids[]" value="{$t.id}" />
                            <span></span>
                        </label>
                    </td>
                    {/if}
                    <td style="text-align:center"> <input type="text" onblur="dr_ajax_save(this.value, '{dr_url('linkage/displayorder_edit', ['key'=>$key,'id'=>$t.id])}')" value="{$t.displayorder}" class="displayorder form-control input-sm input-inline input-mini"> </td>
                    <td style="text-align:center">
                        <a href="javascript:;" onclick="dr_ajax_open_close(this, '{dr_url('linkage/hidden_edit', ['key'=>$key,'id'=>$t.id])}', 1);" class="badge badge-{if $t.hidden}no{else}yes{/if}"><i class="fa fa-{if $t.hidden}times{else}check{/if}"></i></a>
                    </td>
                    <td>{$t.id}</td>
                    <td>{dr_strcut($t.name, 20)} / {dr_strcut($t.cname, 20)} </td>
                    <td>
                        {if $ci->_is_admin_auth('add')}<label><a href="javascript:dr_iframe('add', '{dr_url('linkage/listk_add', ['key'=>$key, 'pid'=>$t.id])}');" class="btn btn-xs blue"> <i class="fa fa-plus"></i> {dr_lang('快速添加')} </a></label>{/if}
                        {if $ci->_is_admin_auth('edit')}<label><a href="{dr_url('linkage/list_edit', ['key'=>$key, 'id'=>$t.id])}" class="btn btn-xs green"> <i class="fa fa-edit"></i> {dr_lang('修改')} </a></label>{/if}
                        {if $t.child}<label><a href="{dr_url('linkage/list_index', ['key'=>$key, 'pid'=>$t.id])}" class="btn btn-xs dark"> <i class="fa fa-table"></i> {dr_lang('下级数据管理')} </a></label>{/if}
                    </td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>


    </form>
</div>

{template "footer.html"}